let oBody = document.querySelector("body");
let oDiv = document.querySelector("#star");
let oDiv1 = document.querySelector("#star1")
    ,oDiv2 = document.querySelector("#star2")
    ,oDiv3 = document.querySelector("#star3")
    ,oDiv4 = document.querySelector("#star4")
    ,oDiv5 = document.querySelector("#star5");
let username = document.querySelector("#username")
    ,password = document.querySelector("#password");
let oRegister = document.querySelector("#register")
    ,oLogin = document.querySelector("#login")
    ,oImg = document.querySelector("#register img")
    ,oRegister_ = document.querySelector("#register_");
console.log(oImg);
username.onclick = function(){
    username.value="";
}
password.onclick = function(){
    password.value="";
}
oRegister.onclick = function(){
    if(username.value!=""&&password.value!=""){
        alert("注册成功！");
        window.location.href="./main.html"
    }else{
        alert("用户名或密码不能为空!");
    }
}
oRegister_.onclick = function(){
    oImg.src = "./img/确认按钮.png";
}
oLogin.onclick = function(){
    oImg.src = "./img/登录按钮.png";
}
setInterval(function(){
        oDiv.style.left = 10+Math.random()*1326+"px";
        oDiv.style.top = 10+Math.random()*628+"px";
        oDiv.style.display = "block";
        oBody.appendChild(oDiv);
    },2000)
setInterval(function(){
        oDiv.parentNode.removeChild(oDiv);
    },4000)
setInterval(function(){
    oDiv1.style.left = 10+Math.random()*1326+"px";
    oDiv1.style.top = 10+Math.random()*628+"px";
    oDiv1.style.display = "block";
    oBody.appendChild(oDiv1);
},2000)
setInterval(function(){
    oDiv1.parentNode.removeChild(oDiv1);
},4000)
setInterval(function(){
    oDiv2.style.left = 10+Math.random()*1326+"px";
    oDiv2.style.top = 10+Math.random()*628+"px";
    oDiv2.style.display = "block";
    oBody.appendChild(oDiv2);
},2000)
setInterval(function(){
    oDiv2.parentNode.removeChild(oDiv2);
},4000)
setInterval(function(){
    oDiv3.style.left = 10+Math.random()*1326+"px";
    oDiv3.style.top = 10+Math.random()*628+"px";
    oDiv3.style.display = "block";
    oBody.appendChild(oDiv3);
},2000)
setInterval(function(){
    oDiv3.parentNode.removeChild(oDiv3);
},4000)
setInterval(function(){
    oDiv4.style.left = 10+Math.random()*1326+"px";
    oDiv4.style.top = 10+Math.random()*628+"px";
    oDiv4.style.display = "block";
    oBody.appendChild(oDiv4);
},2000)
setInterval(function(){
    oDiv4.parentNode.removeChild(oDiv4);
},4000)
setInterval(function(){
    oDiv5.style.left = 10+Math.random()*1326+"px";
    oDiv5.style.top = 10+Math.random()*628+"px";
    oDiv5.style.display = "block";
    oBody.appendChild(oDiv5);
},2000)
setInterval(function(){
    oDiv5.parentNode.removeChild(oDiv5);
},4000)

